<?php

class RefCutiDao{
	
	public function getCuti($id){
        require_once('class.database.php');
		$db=Database::getInstance();
        $con=$db->getConnection(1);

        $query="SELECT * FROM ref_cuti WHERE kode='$id'";

        $result=$con->prepare($query);
        $result->execute();

        if($result->rowCount()==1){
            $data=$result->fetch();
            return $data['uraian'];
        }

        return false;
	}

    public function getRefCuti(){
        require_once('class.database.php');
        
        $db=Database::getInstance();
        $con=$db->getConnection(1);

        $query="SELECT * FROM ref_cuti";

        $result=$con->prepare($query);
        $result->execute();

        if($result->rowCount()>=1){
            $data=$result->fetchAll();
            return $data;
        }

        return false;
    }
}

class RefCuti{
	
	var $id_cuti;
	var $nama_cuti;

}


?>